function mycarousel_initCallback(carousel)
{
	displayNavButtons(carousel, false);
    // Disable autoscrolling if the user clicks the prev or next button.
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });

    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    });
    
    carousel.buttonNext.hover(function() {
    	displayNavButtons(carousel, true);
    }, function() {
    	displayNavButtons(carousel, false);
    });
    
    carousel.buttonPrev.hover(function() {
    	displayNavButtons(carousel, true);
    }, function() {
    	displayNavButtons(carousel, false);
    });
    
    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
    	displayNavButtons(carousel, true);
        carousel.stopAuto();
    }, function() {
    	displayNavButtons(carousel, false);
        carousel.startAuto();
    });
	//$("#mycarousel li").css("display","block");
};

function displayNavButtons(carousel, display)
{
	if( display == false )
	{		
		carousel.buttonNext.css("opacity","0");
		carousel.buttonNext.css("filter","alpha(opacity=0)");
		carousel.buttonPrev.css("opacity","0");
		carousel.buttonPrev.css("filter","alpha(opacity=0)");
	}
	else
	{
		carousel.buttonNext.css("opacity","1.0");
		carousel.buttonNext.css("filter","alpha(opacity=100)");
		carousel.buttonPrev.css("opacity","1.0");
		carousel.buttonPrev.css("filter","alpha(opacity=100)");
	}
};

jQuery(document).ready(function() {
    jQuery('#mycarousel').jcarousel({
        auto: 3,
        wrap: 'last',
        initCallback: mycarousel_initCallback
    });
});